package marmalius.command.admin;

import marmalius.NPCHandler;
import marmalius.Player;
import marmalius.command.BaseCommand;

public class Spawn extends BaseCommand {

	public void process(Player player, String[] command) {
		if (command == null || command.length != 1) {
			showHelp(player);
			return ;
		}
		
		int newNPC = Integer.parseInt(command[0]);
		if (NPCHandler.getInstance().checkNpcId(newNPC)) {
			NPCHandler.getInstance().newNPC(newNPC, player.getAbsX(), player.getAbsY(), player.getAbsH(), player.getAbsX() + 10, player.getAbsY() + 10, player.getAbsX() - 10, player.getAbsY() - 10, 1, NPCHandler.getInstance().GetNpcListHP(newNPC), false);
			player.sendPlayerMessage("You spawn an npc");
		}
		else
			player.sendPlayerMessage("Npc not found : "+newNPC);
		
	}
	
}
